const {
  getUserInfo
} = require("../src/newservice/user");
const {
  getGroupDetails,
  getGroupInfo
} = require("../src/newservice/group");

const {
  getdocs,
  getDocsDetails
} = require("../src/newservice/docs");

const {
  getReposInfo,
} = require("../src/newservice/repo");

// {
//   id: 29364379,
//   space_id: 0,
//   organization_id: 16064585,
//   login: 'swmudr',
//   name: '学习记录',
//   description: '统一学习记录',
// }
async function main() {
  // 获取个人信息
  let res = await getUserInfo();
  // 获取组织的信息
  let groupRes = await getGroupInfo(res.data.data.id);
  let details = await getGroupDetails(groupRes.data.data[0].id);

  //获取仓库信息
  let repos = await getReposInfo(details.data.data.id);

  //获取仓库的列表
  let docs = await getdocs(repos.data.data[0].id)
  //获取仓库的详情
  let val = await getDocsDetails(repos.data.data[0].id, docs.data.data[0].slug)

  console.log(repos.data.data)
}

main()